<template>
  <!-- 我是康复训练校长界面 -->
  <div >
    <div >
      <Header title="康复训练" subtitle="" />
    </div>
    <div style="display: flex; justify-content: space-between;margin:1vh 0px">
      <div style="margin-left:3vw"><h2>康复训练</h2></div>
      <div style="margin-right:3vw">
        <el-input
          v-model="input"
          style="width: 240px"
          placeholder="按名字搜索"
        />
      </div>
    </div>
    <div>
      <el-descriptions
        :column="3"
        border
        v-for="item in tableData"
        :key="item.id"
        style="margin-bottom: 10px"
      >
        <el-descriptions-item
          label="姓名"
          label-align="center"
          align="center"
          :rowspan="1"
          :width="140"
        >
          <div
            style="
              width: 100%;
              white-space: nowrap;
              overflow: hidden;
              text-overflow: ellipsis;
            "
          >
            {{ item.name }}
          </div>
        </el-descriptions-item>
        

         <el-descriptions-item
          label="日期"
          label-align="center"
          align="center"
          :rowspan="1"
          :width="140"
        >
        {{item.date}}
         </el-descriptions-item>

        <el-descriptions-item
          label="详情"
          :rowspan="1"
          label-align="center"
          align="center"
        >
          <el-button @click="openDialog(item)">查看详情</el-button>
        </el-descriptions-item>
        
      </el-descriptions>
    </div>
  </div>
</template>

<script setup>
import { useRouter } from "vue-router";
import { ref, computed } from "vue";
import Header from '@/components/titleHeader/TitleHeader.vue';


// const dialogVisible = ref(false);
// const dialogFormVisible = ref(true);
// const formLabeWidth = "140px";
const router = useRouter();
const input = ref("");
const rowData = ref({});
const openDialog = (row) => {
  rowData.value = row;
  console.log(rowData);
  // dialogFormVisible.value = true;
  router.push('/parentRehabilitationTraining')
};

const tableData = ref([
  {
    id: 1,
    date: "2016-05-04",
    name: "Aleyna Kutzner",
    address: "Lohrbergstr. 86c, Süd Lilli, Saarl",
    sex: "男",
    phone: "1555344874",
    know: "微信",
    status: "未入训",
    type: "老师",
    buzhi: "20",
    wangcheng: "10",
    text: "",
  },
  {
    id: 2,
    date: "2016-05-03",
    name: "Helen Jacobi",
    address: "760 A Street, South Frankfield, Illinois",
    sex: "男",
    phone: "1555344874",
    know: "微信",
    status: "以入训",
    type: "老师",
    buzhi: "20",
    wangcheng: "10",
  },
  {
    id: 3,
    date: "2016-05-02",
    name: "Brandon Deckert",
    address: "Arnold-Ohletz-Str. 41a, Alt Malinascheid, Thüringen",
    sex: "女",
    phone: "1555344874",
    know: "微信",
    status: "未入训",
    type: "老师",
    buzhi: "20",
    wangcheng: "10",
  },
  {
    id: 4,
    date: "2016-05-01",
    name: "Margie Smith",
    address: "23618 Windsor Drive, West Ricardoview, Idaho",
    sex: "女",
    phone: "1555344874",
    know: "微信",
    status: "未入训",
    type: "老师",
    buzhi: "20",
    wangcheng: "10",
  },
  {
    id: 5,
    date: "2016-05-01",
    name: "Margie Smith",
    address: "23618 Windsor Drive, West Ricardoview, Idaho",
    sex: "女",
    phone: "1555344874",
    know: "微信",
    status: "未入训",
    type: "老师",
    buzhi: "20",
    wangcheng: "10",
  },
]);
</script>

<style  scoped>
:deep(.my-label) {
}
:deep(.my-content) {
  width: 300px !important;
}
</style>